
NEW_NAME=$1
if [ -z $NEW_NAME ]; then
  echo "clone-vm <new vm name>"
  exit 1
fi

NEW_VM_DISK="/var/lib/libvirt/images/${NEW_NAME}.qcow2"
TEMPLATE_DISK="/var/lib/libvirt/images/template-ubuntu2204.qcow2"
sudo qemu-img create -f qcow2 -b $TEMPLATE_DISK  $NEW_VM_DISK
echo "vm ${NEW_NAME}created"
